<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

//
//return [
//    '__pattern__' => [
//        'name' => '\w+',
//    ],
//    '[hello]'     => [
//        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
//        ':name' => ['index/hello', ['method' => 'post']],
//    ],
//
//];


use think\Route;

Route::get('test','api/test/index');
Route::put('test/:id','api/test/update');
Route::delete('test/:id','api/test/delete');


/// x.com/test  post => api/test/save
Route::resource('test', 'api/test');


Route::get('api/:ver/cat','api/:ver.cat/read');
Route::get('api/:ver/index','api/:ver.index/index');
Route::get('api/:ver/init','api/:ver.index/init');

// news
Route::resource('api/:ver/news', 'api/:ver.news');
//排行
Route::resource('api/:ver/rank', 'api/:ver.rank');
//短信验证码相关
Route::resource('api/:ver/identify', 'api/:ver.identify');
//登录的路由
Route::post('api/:ver/login', 'api/:ver.login/save');

Route::get('api/:ver/send','api/:ver.send/index');


Route::resource('api/:ver/user','api/:ver.user');

//图片上传的路由
Route::post('api/:ver/image', 'api/:ver.image/save');

//点赞
Route::post('api/:ver/upvote', 'api/:ver.upvote/save');
//取消点赞
Route::delete('api/:ver/upvote', 'api/:ver.upvote/delete');
//取消点赞
Route::get('api/:ver/upvote/:id', 'api/:ver.upvote/read');

//评论的路由
Route::post('api/:ver/comment', 'api/:ver.comment/save');
Route::get('api/:ver/comment/:id', 'api/:ver.comment/read');